package com.spica.platform.base.feign.fallback;


import com.google.common.collect.ImmutableList;
import com.spica.platform.base.feign.AsyncMenuFeignClient;
import lombok.extern.slf4j.Slf4j;
import reactivefeign.FallbackFactory;
import reactor.core.publisher.Mono;

/**
 * menuService降级工场
 */
@Slf4j
public class AsyncMenuFeignClientFallbackFactory implements FallbackFactory<AsyncMenuFeignClient> {@Override
	public AsyncMenuFeignClient apply(Throwable throwable) {
		return (clientId,roleIds) -> {
			log.error("调用findByRoleCodes异常：{}", roleIds, throwable);
			return Mono.just(ImmutableList.of());
		}; 
	}
}
